<?php
// Define TimeZone & Config file
Yii::app()->setTimeZone('Asia/Ho_Chi_Minh');
define ('IMAGES_DIR', dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR);
define('CONFIG_MAIN_FILE', dirname(dirname(dirname(dirname(__FILE__)))).DIRECTORY_SEPARATOR.'protected/config/config.php');
define('CONFIG_FILE', dirname(__FILE__).DIRECTORY_SEPARATOR.'config.php');
require(CONFIG_FILE);

return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'NexttopEVENT System Manager',
	'defaultController'=>'Home/default/index',
	'theme'=>'metro',
	'sourceLanguage'=>'en',
        'language'      =>'vi',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'1',
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		// Dashboard module
		'Dashboard',
		// Event module
		'Events',
		// News module
		'News',
                'Home',
        // Orders module
        'Orders',
		// Users module
		'Users',
	),

	// application components
	'components'=>array(
		'user'=>array(
			'allowAutoLogin'=>true,
			'loginUrl'=>array('/Dashboard/default/login'),
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=nexttope_main',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
		),
		'errorHandler'=>array(
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			),
		),
	),
	'params'=>array(
		'adminEmail'=>'webmaster@example.com',
	),
);